import pmRequest from '../index'
import { IAccount, ILoginResult } from './type'
import { IDataType } from '../type'

export function accountLoginRequest(account: IAccount) {
  return pmRequest.post<IDataType<ILoginResult>>({
    url: '/login',
    isShowLoading: false,
    data: account
  })
}

export function requestUserInfoById(id: number) {
  return pmRequest.get<IDataType>({
    url: `/users/${id}`,
    isShowLoading: false
  })
}

export function requestUserMenusByRoleId(id: number) {
  return pmRequest.get<IDataType>({
    url: `/role/${id}/menu`,
    isShowLoading: false
  })
}
